package file

import (
	"chainmaker.org/chainmaker/smarteditor/session"
	"chainmaker.org/chainmaker/smarteditor/util"

	"github.com/88250/gulu"
)

//HasAccessPermission check user whether or not have access permission for give path
func HasAccessPermission(uid, filePath string) bool {
	if gulu.Go.IsAPI(filePath) || util.BelongsGoPath(filePath) || !session.CanAccess(uid, filePath) {
		return false
	}
	return true
}
